import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:syn_4s/core/extension/int_extension.dart';

import '../../widgets/custom_ui.dart';
import '../../widgets/main_drawer.dart';

abstract class BaseScreen extends StatelessWidget {
  const BaseScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      drawer: const MainDrawer(),
      appBar: getAppBar(title(context)),
      // appBar: AppBar(
      //   title: Text(title(context)),
      //   actions: titleActions(context),
      //   leading: leadingWidget(context),
      // ),
      body: body(context),
    );
  }

  String title(BuildContext context) {
    return "";
  }

  Widget? leadingWidget(BuildContext context) {
    return null;
  }

  /// 右边按钮或控件
  List<Widget>? titleActions(BuildContext context) {
    return null;
  }

  Widget body(BuildContext context);

  Widget buildCloseIcon() {
    return IconButton(
        onPressed: () {
          Get.back();
        },
        iconSize: 30.px,
        icon: const Icon(
          Icons.close,
          color: Colors.white,
        ));
  }
}
